#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "iot_uart.h"
#include "iot_os.h"
#include "porting.h"

// port printf to uart usb
int my_printf(const char* fmt, ...)
{
  char line_buf[512];

  int len;
  va_list ap;

  va_start(ap, fmt);
  len = vsprintf(line_buf, fmt, ap);
  va_end(ap);

  return iot_uart_write(SHELL_UART_PORT, line_buf, len);
}

void* get_current_task_handle()
{
  return iot_os_current_task();
}
